% spm_vec

n = 100;
t = zeros(1,n);
f = {speye(2^9),eye(2^9),ones(2^9,2^9)*1i};

for i = 1:n
    
    %spm_cat({speye(2^i),[],[];[],eye(2^i),[];[],[],ones(2^i,2^i)*1i });
    l = cell(1,i);
    [l{:}] = deal(f);
    tic;
    r = spm_vec(l);
    t(i) = toc;
end


plot(t,'r','linewidth',2);
title('spm\_vec');
xlabel('Array size');
ylabel('Secs');


% spm_unvec
figure;
n = 100;
t = zeros(1,n);
f = {speye(2^9),eye(2^9),ones(2^9,2^9)*1i};

for i = 1:n
    l = cell(1,i);
    [l{:}] = deal(f);
    tmp = spm_vec(l)*0.1;
    tic;
    r = spm_unvec(tmp,l);
    t(i) = toc;
end


plot(t,'r','linewidth',2);
title('spm\_vec');
xlabel('Array size');
ylabel('Secs');

